package com.orangelife.mobile.pay.view;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.PopupWindow;

import com.curry.orangelife.mobile.R;

/**
 * <p>
 * Created by 吴格非 on 2016-12-30.
 * <p>
 *
 * @author 吴格非
 * @since v1.0.0
 */

public class PayPwdPopWin extends PopupWindow {

    private Context context;

    public PayPwdPopWin(Context context) {
        this.context = context;
        initView();
        setPopWinAttr();
    }

    private void initView() {
        View contentView = LayoutInflater.from(context).inflate(
                R.layout.dialog_pay_pwd, null);
        setContentView(contentView);
    }

    private void setPopWinAttr() {
        /* 设置popupwindow的基本属性 */
        this.setBackgroundDrawable(new ColorDrawable(context.getResources().getColor(R.color.white)));
        this.setWidth(android.view.ViewGroup.LayoutParams.MATCH_PARENT);
        this.setHeight(android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
        /* 设置捕获popupwindow外的点击焦点 */
        this.setOutsideTouchable(true);
    }

}
